<?php
if( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * 品牌model层
 * @author Toby.Tu 2016-09-02
 */
class Brand_model extends My_Model{
    public $tab = 'brand';
    public $pk = 'id';
    /**
     * 获取全部
     * @author Toby.tu 2016-09-02
     */
    public function getAll($tab=''){
        if(empty($tab)) $tab = $this->getTab();
        $field = 'id,name,code,description,status,create_time,update_time';
        $query = $this->db->select($field)->where('deleted',0)->order_by('update_time desc')->get($tab);
        if(!empty($query)){
            return $query->result_array();
        }
        return array();
    }
}
